package com.csweimei.rentmanagementtreasure.tenant.viewModel;

import android.os.Bundle;

import androidx.annotation.NonNull;
import androidx.databinding.ObservableField;

import com.csweimei.rentmanagementtreasure.base.AppConfig;
import com.csweimei.rentmanagementtreasure.http.entity.TabThreeBean;
import com.csweimei.rentmanagementtreasure.tenant.ui.act.MessageInfoActivity;

import me.goldze.mvvmhabit.base.BaseViewModel;
import me.goldze.mvvmhabit.base.MultiItemViewModel;
import me.goldze.mvvmhabit.binding.command.BindingAction;
import me.goldze.mvvmhabit.binding.command.BindingCommand;

public class TabThreeItemVM extends MultiItemViewModel {

    FThreeVM fThreeVM;
    public TabThreeItemVM(@NonNull BaseViewModel viewModel) {
        super(viewModel);
        fThreeVM = (FThreeVM) viewModel;
    }

    public ObservableField<TabThreeBean.DataDTO> entity = new ObservableField<>();

    public void setData(TabThreeBean.DataDTO bean) {
        entity.set(bean);
    }


    public BindingCommand itemClick = new BindingCommand(() -> {
        fThreeVM.lookMsg(entity.get().getMessageType());
        Bundle bundle = new Bundle();
        bundle.putSerializable(AppConfig.BUNDLE_KEY,entity.get());
        viewModel.startActivity(MessageInfoActivity.class,bundle);

    });
}
